home *** CD-ROM | disk | FTP | other *** search
/ F1 Licenseware / F1 Licenseware - Volume 1.iso / disks / 050a.dms / 050a.adf / TEXTS / chapter09.txt < prev    next >
Text File  |  1992-02-26  |  5KB  |  146 lines

  1.  
  2.                      The Absolute Beginners Guide To Amos
  3.                     -------------------------------------
  4.                                  Chapter nine
  5.                                  ------------
  6.  
  7.         Here are the answers from the self test quiz in chapter eight:
  8.  
  9.                                  1. A    6. C
  10.                                  2. B    7. A
  11.                                  3. C    8. C
  12.                                  4. C    9. B
  13.                                  5. B   10. B
  14.  
  15.       If you got less than five correct, re-read the relevant chapters.
  16.      --------------------------------------------------------------------
  17.  
  18. Since we have covered quite a lot of ground I think it`s about time we
  19. concentrated for a while on some programming that will be of a bit more
  20. practical use, although we still have a lot of commands to learn.
  21.  
  22. EXAMPLE9.Amos Is a small piece of code that will LOAD an IFF picture and a 
  23. TRACKer module, display the picture and PLAY the mod. 
  24. When any key is pressed by the user the music will stop and the contents of 
  25. the memory banks of Amos will be displayed. 
  26. All this probably sounds like we have a long program coming up, 
  27. not so, we could fit the whole program on one line if we wanted to.
  28.  
  29. EXAMPLE9.Amos
  30. -------------
  31.  
  32. HIDE
  33.  
  34. LOAD IFF "DF0:PICS/SONIC.IFF",0
  35.  
  36. TRACK LOAD "DF0:MUSIC/MOD.FUN",5
  37.  
  38. TRACK PLAY 5
  39.  
  40. TRACK LOOP ON
  41.  
  42. CLEAR KEY
  43.  
  44. WAIT KEY
  45.  
  46. TRACK STOP
  47.  
  48. LISTBANK
  49.  
  50.  
  51. And that is it, neat isn`t it? 
  52.  
  53. HIDE
  54. ----
  55. HIDE the mouse pointer as it`s not needed.
  56.  
  57.  
  58. LOAD IFF "DF0:PICS/SONIC.IFF",0
  59. --------------------------
  60. Well covered in an earlier chapter, LOADs an IFF picture into screen 0.
  61.  
  62.  
  63. TRACK LOAD "DF0:MUSIC/MOD.FUN",5
  64. ----------------------------
  65. A new one, the TRACK LOAD command LOADs a TRACKer module into the memory
  66. bank number defined by you after the comma. In this case I used bank five.
  67. Don`t worry why, we will be covering memory banks soon enough.
  68.  
  69. NOTE: If TRACK LOAD throws up a syntax error chances are you are using an old
  70. out of date version of Amos as the TRACKer commands were only implemented in
  71. V1.34+ of the original Amos package.  I am not sure about Easy Amos as I do 
  72. not own a copy of that, but you will be OK with Amos Pro. 
  73. If you do have problems with this you can get an updater disk from most P.D 
  74. libraries. At the time of writing I am using V1.36 of Amos original.
  75.  
  76. NOTE 2: There is a bug in the TRACK LOAD command that forces you to include
  77. the DF0: or DF1: statement at the start like this: TRACK LOAD "DF0: etc.
  78. If you don`t put it you will get an error.  This applies to Amos original.
  79. I am not sure about the other versions.
  80.  
  81.  
  82. TRACK PLAY 5
  83. ------------
  84. This is the command that actually PLAYs the TRACKer music, there are more
  85. options you can add to TRACK PLAY but we don`t need to go into that here.  
  86. The 5 is the bank we loaded the Tracker mod into.  
  87.  
  88.  
  89. TRACK LOOP ON
  90. -------------
  91. AS default TRACK LOOP is set to OFF so the module will only play once and 
  92. then stop. To make the module LOOP continuously we simply set TRACK LOOP ON 
  93. the opposite to this command is TRACK LOOP OFF.  I think there may also be
  94. a bug as some mods I have tried will not loop correctly.
  95.  
  96.  
  97. CLEAR KEY 
  98. ---------
  99. Is a simple but very useful command. CLEAR KEY, CLEARs the keyboard buffer of
  100. any KEY presses currently stored there.  This doesn`t sound that fantastic 
  101. until you start writing a program to detect key presses.  You don`t really
  102. need to understand what it does just remember to use CLEAR KEY before any
  103. WAIT KEY instruction from now on.
  104.  
  105.  
  106. WAIT KEY
  107. --------
  108. We know all about this, WAITs for any KEY press.
  109.  
  110.  
  111. TRACK STOP
  112. ----------
  113. Can you guess what this does? Yes it STOPs the TRACKer music playing.
  114.  
  115.  
  116. LISTBANK
  117. --------
  118. This command is one you wouldn`t normally use inside a program, it`s a system
  119. command really, it displays a LIST of any memory BANKs currently used in
  120. your program and you should have a display looking something like this:
  121.  
  122. 5 - TRACKER  S : $0005664  L : $00000678
  123.  
  124. Or similar.  This information tells us that bank 5 five contains a
  125. tracker module the S is the start address of the bank and the number after
  126. the L is the length of the bank, the numbers are in Hexadecimal, we will not
  127. be covering Hex in this tutorial as it is of limited use to the beginner.
  128.  
  129. If you were writing a program and wished to check how many banks you had in 
  130. use or whatever, the normal practice would be to press escape and type in 
  131. LISTBANK.  The point of me putting LISTBANK at the end of the program is to
  132. introduce you to the concept of banks gently.
  133.  
  134. Now load up Example9.Amos and read through the listing. Run it a few times
  135. and try getting the program to load one of your own pictures and mods. If
  136. you don't have any pictures lying around then try loading the different
  137. pictures on this disk. They are inside the PICS drawer. To find out what 
  138. pictures are in the PICS drawer press escape then type in:
  139.  
  140. DIR"df0:PICS/"
  141.  
  142. And press return.
  143.  
  144.                              End of chapter nine
  145.                              ^^^^^^^^^^^^^^^^^^^
  146.